<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>在线测试--查看错题</title>
		<link rel="stylesheet" type="text/css" href="../css/answer.css"/>
		<script type="text/javascript" src="../js/jquery.js"></script>
		<style type="text/css">
			.show{
				background: #ffff00;
				color: #ff0000;
				width: 380px;
				padding-left:20px;
				font-size:20px;
				font-weight: bold;
			}
			
			.trueOption{
				color:green;
				width: 180px;
				display: inline-block;
			}
			.falseOption{
				color:red;
				width: 180px;
				display: inline-block;
			}
		</style>
	</head>
	<body>
		<div class="main">
				<div id="answer">
					
				</div>
				<div class="submit btn" >
					<a href="main.html">重新答题</a>
				</div>
		</div>
	</body>
<script >
	//答题数量
	var answerNum;
	$(function(){
		//从后台获取页面要显示的数据
		$.post(
			"../Marks?type=lookError",
			{},
			function(data){
				var inputType;
				answerNum=data.length;
				for (var i=0; i<answerNum;i++) {
					$("#answer").append(
						"<div class='content'>"
							+"<div class='qtext'><span>"+data[i].errorid+".&ensp;</span><pre>"+data[i].qtext+"</pre></div>"
							+"<div class='option'><label>A.&nbsp;"+data[i].option_a+"</label></div>"
							+"<div class='option'><label>B.&nbsp;"+data[i].option_b+"</label></div>"
							+"<div class='option'><label>C.&nbsp;"+data[i].option_c+"</label></div>"
							+"<div class='option'><label>D.&nbsp;"+data[i].option_d+"</label></div>"
							+"<div class='show'><span class='trueOption'>正确答案："+data[i].option_true+"</span><span class='falseOption'>你的答案："+data[i].option_stu+"</span> </div>"
						+"</div>"
					);
				}
			},
			"json"
		);
	})
</script>
</html>
